import { defineStore } from "pinia";

interface AuthStore {
  // 菜单
  menus: any[];
  // 按钮、模块权限
  permissions: any[];
}

export const useAuthStore = defineStore("authState", {
  state: (): AuthStore => ({
    menus: [
      {
        path: "/routing",
        component: null,
        redirect: "user",
        children: [
          {
            path: "/routing/user",
            component: "/user.vue",
            name: "用户管理",
            meta: {},
          },
          {
            path: "/routing/menu",
            component: "/menu.vue",
            name: "菜单管理",
            meta: {},
          }
        ],
        name: "系统管理",
        meta: undefined,
      },
    ],
    permissions: [
      // '*:*:*', // 所有权限
      'system:user:create',
      'system:user:update',
      'system:user:delete',
    ]
  }),
  getters: {},
  actions: {},
});
